-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: initialize this project #1
Conversation
eddyxu
commented
Nov 30, 2024
•
edited
Loading
edited
- Setting up CI
- Get DX working
- InMemoryCache
log = "~0.4" | ||
moka = { version = "~0.12", features = ["future"] } | ||
num_cpus = "1.16" | ||
object_store = "~0.11" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have a range here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is 0.11,<0.12
? Can we use more than that?
[dependencies] | ||
async-trait = "0.1" | ||
bytes = "~1.9" | ||
futures = "0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~
categories = ["caching"] | ||
|
||
[dependencies] | ||
async-trait = "0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~
# ocra | ||
OCRA: Object-store Cache in Rust for All | ||
# OCRA | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need an okra emoji lol
use crate::{paging::PageCache, Error, Result}; | ||
|
||
/// Default memory page size is 8 MB | ||
pub const DEFAULT_PAGE_SIZE: usize = 8 * 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this 16KiB? 8MIB is kinda huge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
/// Default memory page size is 8 MB | ||
pub const DEFAULT_PAGE_SIZE: usize = 8 * 1024 * 1024; | ||
const DEFAULT_TIME_TO_LIVE: Duration = Duration::from_secs(60 * 30); // 30 minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we default to no TTL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default time to idle makes more sense since we are CoW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this was time to idle. Forgot to rename it.
/// [PageCache] trait. | ||
/// | ||
/// Caching fixed-size pages. Each page has a unique ID. | ||
#[async_trait] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need dynamic dispatching here? can we do with just static dispatch with -> impl Future<...>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need some rust help then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm for starting point